home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / GraphicsCards / StormMesa / src-glu / tess.h < prev    next >
C/C++ Source or Header  |  1998-12-15  |  3KB  |  128 lines

  1. /* $Id: tess.h,v 1.3 1997/10/29 02:02:20 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.3
  6.  * Copyright (C) 1995-1997  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: tess.h,v $
  26.  * Revision 1.3  1997/10/29 02:02:20  brianp
  27.  * various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver)
  28.  *
  29.  * Revision 1.2  1997/05/24 13:30:58  brianp
  30.  * added TESS_H multi-inclusion prevention test
  31.  *
  32.  * Revision 1.1  1996/09/27 01:19:39  brianp
  33.  * Initial revision
  34.  *
  35.  */
  36.  
  37.  
  38. /*
  39.  * This file is part of the polygon tesselation code contributed by
  40.  * Bogdan Sikorski
  41.  */
  42.  
  43.  
  44. #ifndef TESS_H
  45. #define TESS_H
  46.  
  47.  
  48. #include "gluP.h"
  49.  
  50. #define EPSILON 1e-06 /* epsilon for double precision compares */
  51.  
  52. typedef enum
  53. {
  54.     OXY,
  55.     OYZ,
  56.     OXZ
  57. } projection_type;
  58.  
  59. #if defined(AMIGA) && defined(__PPC__)
  60. void beginPPC( GLenum mode );
  61. void edgeFlagPPC( GLboolean flag );
  62. void vertexPPC( GLvoid *v );
  63. void endPPC( void );
  64. void errorPPC( GLenum err );
  65. #endif
  66.  
  67. typedef struct callbacks_str
  68. {
  69.     void (CALLBACK *begin)( GLenum mode );
  70.     void (CALLBACK *edgeFlag)( GLboolean flag );
  71.     void (CALLBACK *vertex)( GLvoid *v );
  72.     void (CALLBACK *end)( void );
  73.     void (CALLBACK *error)( GLenum err );
  74. #if defined(AMIGA) && defined(__PPC__)
  75.     void (CALLBACK *beginPPC)( GLenum mode );
  76.     void (CALLBACK *edgeFlagPPC)( GLboolean flag );
  77.     void (CALLBACK *vertexPPC)( GLvoid *v );
  78.     void (CALLBACK *endPPC)( void );
  79.     void (CALLBACK *errorPPC)( GLenum err );
  80. #endif
  81. } tess_callbacks;
  82.  
  83. typedef struct vertex_str
  84. {
  85.     void                            *data;
  86.     GLdouble                        location[3];
  87.     GLdouble                        x,y;
  88.     GLboolean                       edge_flag;
  89.     struct vertex_str       *shadow_vertex;
  90.     struct vertex_str       *next,*previous;
  91. } tess_vertex;
  92.  
  93. typedef struct contour_str
  94. {
  95.     GLenum                          type;
  96.     GLuint                          vertex_cnt;
  97.     GLdouble                        area;
  98.     GLenum                          orientation;
  99.     struct vertex_str       *vertices,*last_vertex;
  100.     struct contour_str      *next,*previous;
  101. } tess_contour;
  102.  
  103. typedef struct polygon_str
  104. {
  105.     GLuint                          vertex_cnt;
  106.     GLdouble                        A,B,C,D;
  107.     GLdouble                        area;
  108.     GLenum                          orientation;
  109.     struct vertex_str       *vertices,*last_vertex;
  110. } tess_polygon;
  111.  
  112. struct GLUtriangulatorObj
  113. {
  114.     tess_contour            *contours,*last_contour;
  115.     GLuint                          contour_cnt;
  116.     tess_callbacks          callbacks;
  117.     tess_polygon            *current_polygon;
  118.     GLenum                          error;
  119.     GLdouble                        A,B,C,D;
  120.     projection_type         projection;
  121. };
  122.  
  123.  
  124. extern void tess_call_user_error(GLUtriangulatorObj *,GLenum);
  125.  
  126.  
  127. #endif
  128.